﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="_2021_6_11.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            账号：<asp:TextBox ID="account" runat="server" Text="" />
            <asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="account" ErrorMessage="账号不能为admin" OnServerValidate="CustomValidator1_ServerValidate" Display="Dynamic" />
            <asp:RequiredFieldValidator runat="server" ControlToValidate="account" ErrorMessage="用户名不能为空" ForeColor="Red" Font-Size="Larger" Display="Dynamic" />
            <br />
            密码：<asp:TextBox ID="password" runat="server" Text="" />
            <asp:RequiredFieldValidator runat="server" ControlToValidate="password" ErrorMessage="必须输入密码" />
            <br />
            确认密码：<asp:TextBox ID="rePass" runat="server" Text="" />
            <asp:CompareValidator ID="compareToPassword" runat="server" ControlToValidate="rePass" ControlToCompare="password" ErrorMessage="两次密码不一致！" />
            <br />
            出生日期：<asp:TextBox ID="birthday" runat="server" Text="" />
            <asp:RangeValidator ID="timeJudge" runat="server" Type="Date" ControlToValidate="birthday" MinimumValue="1990-01-01" MaximumValue="" ErrorMessage="出生日期必须为1990-01-01~现在中的一天" Display="Dynamic" />
            <asp:RegularExpressionValidator ID="date" runat="server" ControlToValidate="birthday" ValidationExpression="\d{4}-\d{2}-\d{2}" ErrorMessage="日期格式需为YYYY-MM-DD" />
            <br />
            毕业日期：<asp:TextBox ID="graduationDate" runat="server" />
            <asp:RegularExpressionValidator ID="graduaDate" runat="server" ControlToValidate="graduationDate" ValidationExpression="\d{4}-\d{2}-\d{2}" ErrorMessage="日期格式需为YYYY-MM-DD" Display="Dynamic" />
            <asp:CompareValidator ID="CompareValidator1" runat="server" Type="Date" ControlToValidate="graduationDate" ControlToCompare="birthday" Operator="GreaterThanEqual" ErrorMessage="毕业日期必须在出生日期之后" />
            <br />
            年龄：<asp:TextBox ID="age" runat="server" Text="" />
            <asp:RangeValidator runat="server" MaximumValue="150" MinimumValue="0" ControlToValidate="age" ErrorMessage="年龄必须在0到150随之间" />
            <br />
            电子邮箱：<asp:TextBox ID="email" runat="server" Text="" />
            <asp:RegularExpressionValidator  ID="RegularExpressionValidator1" runat="server" ControlToValidate="email"  ErrorMessage="邮箱格式错误" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
            <br />
            头像：<asp:FileUpload ID="via" runat="server" />
            <asp:Literal ID="err" runat="server" Text="" ></asp:Literal>
            <br />
            <asp:Image ID="viaView" runat="server" />
            <br />
            <asp:Button runat="server" Text="提交" OnClick="Unnamed_Click" />
            <br />
            <asp:ValidationSummary runat="server" DisplayMode="SingleParagraph" ShowMessageBox="true"/>
        </div>
    </form>
</body>
</html>
